﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for User
/// </summary>
public class UserBLL
{
    public int id { get; set; }
    public string username { get; set; }
    public string password { get; set; }
    public string email { get; set; }
    public string phone { get; set; }
    public string address { get; set; }
    public string name { get; set; }
    public int note { get; set; }

	public UserBLL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public UserBLL(int id, string user, string pass, string emai, string fone, string address, string nam, int not)
    {
        this.id = id;
        this.username = user;
        this.password = pass;
        this.email = emai;
        this.phone = fone;
        this.address = address;
        this.name = nam;
        this.note = not;
    }
    public UserBLL(int id,string user, string passwd,string name, string phone, string adress, string email)
    {
        this.id = id;
        this.username = user;
        this.password = passwd;
        this.name = name;
        this.phone = phone;
        this.address = adress;
        this.email = email; 
    }

    //kiểm tra login
    public bool checkLogin(string username, string password)
    {
        return UserDAL.checkLogin(username, password);
    }
    //Kiểm tra tồn tại user hay email
    public bool checkExistUser(string username)
    {
        return UserDAL.checkExistUser(username);
    }
    public bool checkExistEmail(string email)
    {
        return UserDAL.checkExistEmail(email);
    }
    //kiểm tra đăng ký tài khoản mới
    public bool signupUser(string username, string password, string name, string email, string phone, string address)
    {
        return UserDAL.signupUser(username, password, name, email, phone, address);
    }
    public UserBLL getUserInfo(string username)
    {
        return UserDAL.getUserInfo(username);
    }
    public bool changeUserInfo(UserBLL us)
    {
        return UserDAL.changeUserInfo(us);
    }
    public bool changePasswd(UserBLL us,string pass)
    {
        return UserDAL.changePassword(us, pass);
    }
    public bool updatePassword(UserBLL us)
    {
        return UserDAL.updatePassword(us);
    }
    public bool checkRequestPassword(string user, string email)
    {
        return UserDAL.checkRequestPassword(user, email);
    }
}